+1999-07-18 Larry Ewing <lewing@gimp.org>
+
+ * src/io-xpm.c:
+ * src/io-gif.c:
+ * src/io-png.c:
+ * src/io-jpeg.c: Fix a few memory leaks in the, most of them in
+ error cases but one or two in the common case. There are probably
+ a few small ones left.
+
1999-07-18 Mark Crichton <crichton@gimp.org>
* configure.in: removed version.h.
1999-07-13 Mark Crichton <crichton@gimp.org>
- * configure.in: I am a bonehead. Added gif-lib check.
\ No newline at end of file
+ * configure.in: I am a bonehead. Added gif-lib check.
tmpptr[3] = 0xFF;
tmpptr += (is_trans ? 4 : 3);
}
+ g_free(rows[i]);
}
+ g_free(rows);
/* Ok, now stuff the GdkPixBuf with goodies */
/* Ok, I'm anal...shoot me */
if (!(pixbuf->art_pixbuf)) {
+ art_free(pixels);
g_free(pixbuf);
return NULL;
}
}
image_save() {}
+
+
/* finish off, create the pixbuf */
pixbuf = g_new(GdkPixBuf, 1);
pixbuf->art_pixbuf = art_pixbuf_new_rgb(pixels, w, h, (w * 3));
- if (!(pixbuf->art_pixbuf))
+ if (!(pixbuf->art_pixbuf)) {
+ art_free(pixels);
+ g_free(pixbuf);
return NULL;
+ }
pixbuf->ref_count = 0;
pixbuf->unref_func = NULL;
for (n = 0; n < i; n++)
g_free(rows[i]);
g_free(rows);
+ art_free(pixels);
png_destroy_read_struct(&png_ptr, &info_ptr, &end_info);
return NULL;
}
pixbuf->art_pixbuf = art_pixbuf_new_rgb(pixels, w, h, (w * 3));
/* Ok, I'm anal...shoot me */
- if (!(pixbuf->art_pixbuf))
+ if (!(pixbuf->art_pixbuf)) {
+ art_free(pixels);
+ g_free(pixbuf);
return NULL;
+ }
+
pixbuf->ref_count = 0;
pixbuf->unref_func = NULL;
buffer = (*get_buf) (op_cmap, handle);
if (!buffer) {
g_warning("Can't load XPM colormap");
+ g_hash_table_destroy(color_hash);
g_free(name_buf);
g_free(colors);
return NULL;
}
}
}
+ g_hash_table_destroy(color_hash);
+ g_free(colors);
+ g_free(name_buf);
/* Ok, now stuff the GdkPixBuf with goodies */
pixbuf->art_pixbuf = art_pixbuf_new_rgb(pixels, w, h, (w * 3));
/* Ok, I'm anal...shoot me */
- if (!(pixbuf->art_pixbuf))
- return NULL;
+ if (!(pixbuf->art_pixbuf)) {
+ art_free(pixels);
+ g_free(pixbuf);
+ return NULL;
+ }
+
pixbuf->ref_count = 0;
pixbuf->unref_func = NULL;
- g_hash_table_destroy(color_hash);
- g_free(colors);
- g_free(name_buf);
-
return pixbuf;
}